package com.jml.生命周期003.processor.entity002;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

/**
 * @author:jml
 * @date: 2019/11/5 11:36
 * @description：
 */
@Component
public class PayEntity001 implements BeanNameAware , BeanFactoryAware,
		  InitializingBean {
	
	public PayEntity001() {
		System.out.println("11.对象构造方法完成");
	}
	
	@Override
	//BeanNameAware的实现方法,实例化这个bean的时候会判断是否实现了BeanNameAware接口，如果实现了就调用这个方法
	// 在invokeAwareMethods中执行这个方法
	public void setBeanName(String name) {
		System.out.println("22.对象的beanName: " + name);
	}
	
	@Override
	//BeanFactoryAware的实现方法,实例化这个bean的时候会判断是否实现了BeanFactoryAware接口，如果实现了就调用这个方法
	//在invokeAwareMethods中执行这个方法
	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		System.out.println("33.beanFactory: " + beanFactory);
	}
	
	@Override
	//InitializingBean的实现方法
	public void afterPropertiesSet() throws Exception {
		System.out.println("55.Bean init方法执行");
	}
}
